package com.sfh.base.ui.dialog;

import android.content.DialogInterface;
import android.view.Gravity;

/**
 * 功能描述: 基本对话框实现
 *
 * @date 2016/11/15
 */

public class AlertTemple implements IAlertTemple {

    /***标题*/
    public String title;
    /***内容*/
    public String message;
    /***左按钮文字*/
    public String leftText;
    /***右按钮文字*/
    public String rightText;
    /***左按钮是否显示*/
    public boolean isLeft = true;
    /***内容对齐方式默认居中*/
    public int gravity = Gravity.CENTER;

    public DialogInterface.OnClickListener leftClick = new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    };
    public DialogInterface.OnClickListener rightClick = new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    };

    public AlertTemple() {
        this("");
    }

    public AlertTemple(String message) {
        this("提示", message);
    }

    public AlertTemple(String title, String message) {
        this.title = title;
        this.message = message;
        this.leftText = "取消";
        this.rightText = "确定";
    }

    public String title() {
        return this.title;
    }

    public String message() {
        return this.message;
    }

    public DialogInterface.OnClickListener onLeftClick() {
        return this.leftClick;
    }

    public DialogInterface.OnClickListener onRightClick() {
        return this.rightClick;
    }

    public String leftText() {
        return this.leftText;
    }

    public String rightText() {
        return this.rightText;
    }

    @Override
    public boolean isLeftVisibility() {
        return this.isLeft;
    }

    @Override
    public int gravity() {

        return this.gravity;
    }
}
